package com.zqwm.fly.types;

/**
 * @author songyifei
 * Created by songyifei on 2018-02-27.
 */
public enum ResultType
{
    /**成功的状态值*/
    SUCCESS(1,"成功的状态值"),
    /**异常的状态值*/
    EXCEPTION(0,"异常的状态值");

    int value;
    String name;

    ResultType(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public static ResultType findByValue(Integer value)
    {
        for (ResultType resultType:ResultType.values())
        {
            if(resultType.getValue()==value)
            {
                return resultType;
            }

        }

        return null;
    }

    public int getValue() {
        return value;
    }
    public String getName() {
        return name;
    }
}
